Repository navigation
feat(aggregator): day-type sample-sufficiency re-measure for C4.3 (#13259) - #13290
Conversation
…3259) The C4 design §5 admits a day-type adjustment for a cell only when the cell holds >=8 independent samples; below the gate the state is adjustment_unavailable. Stage-3 deferred the models at ~4-5 samples per weekday (33 days of store history); C4.3 re-measures first. - src/quota-daytype-sufficiency.ts: counts independent samples (distinct America/Chicago dates with >=1 reading) per pool/window over the design grain ladder — weekday, dayclass, daypart, weekday-daypart — over the same rename-joined percent series the S2 harness scores, and renders the report. - scripts/quota-daytype-sufficiency.ts (+ package.json script measure:daytype-sufficiency): the re-measure as a command over the live snapshot store, strict #3352 argument contract. - Tests name their oracles: the §5 gate, the Stage-3 §2 arithmetic reproduced (33 days => 4-5 per weekday, no weekday cell admitted), the §4 Chicago calendar, the §2 rename join. Live re-measure (2026-11-23, 20,979 records, 63 pool/windows, 2,583 cells): 51 cells admitted — all at the coarse grains (daypart 39, dayclass-weekday 12); weekday and weekday-daypart grains admit none (max 4 samples). The measurement is recorded on #13259; the issue stays open on its adjustment + earn-in criteria.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd6dd77cf4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for (const pool of [...index.keys()].sort()) { | ||
| const series = index.get(pool) as SnapshotRecord[]; |
There was a problem hiding this comment.
Aggregate sub-id history into the forecast pool before counting
When a pool's history spans its bare service ID and sub-IDs, this loop measures each indexed key separately instead of measuring the series used by the forecast and S2 harness. For example, meta:high-usage indexes as meta.highusage, but quota-forecast-accuracy.ts::pointsForWindow(index, "meta", window) includes both meta and meta.* records; its existing rename-join test explicitly verifies this behavior. Four distinct Fridays under each spelling therefore give the forecast pool eight samples, while this measurement reports two unavailable four-sample cells. Assemble each canonical forecast pool's history using the same sub-ID acceptance as pointsForWindow before applying the sufficiency gate, so the admission decision covers the series the adjustment will actually use.
Useful? React with 👍 / 👎.
|
🤖 Dispatch record — Lane WF The remote dispatch of the test command (fleet-personal, run 45178649021) completed as a failure at the "Execute target command" step — the fleet-build container environment (the flag-held #13159 family: the container has no bun on PATH, the same failure Lane UT's dispatch recorded today). An environment failure is not a test result. The verifying route is the laptop run, executed against this exact head: new suite 10/10, neighbouring quota suites 41/41 in total, strict scoped |
What this lands
Acceptance criterion 1 of #13259 (C4.3): the sample-sufficiency re-measure the C4 design §5 requires before any day-type adjustment may ship ("Admission is measured, not scheduled (C4.3 re-measures first)").
src/quota-daytype-sufficiency.ts— counts independent samples per pool/window/day-type cell over the snapshot store. A sample is one America/Chicago calendar date with ≥1 reading in the cell (readings inside one occurrence are one burn episode, not independent evidence). Cells are measured on the design's grain ladder:weekday("other Fridays"),dayclass("other weekends"),daypart("same time-of-day on other days"), andweekday-daypart(the finest §5 cell). Inputs are the same rename-joined percent series the S2 accuracy harness scores (indexPercentRecords+FORECAST_WINDOW_METRICS), so the measurement and the harness agree. Gate: ≥8 samples (design §5); below it the cell's state is the design's honesty state,adjustment_unavailable.scripts/quota-daytype-sufficiency.ts(+measure:daytype-sufficiencypackage script) — the re-measure as a command over the live store, with the strict Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 argument contract and the backtest script's reproducibility discipline (--as-ofdefaults to the store, never the wall clock).Live re-measure (2026-11-23, recorded on #13259)
Store: 20,979 records (20,011 percent readings), 2026-10-20 → 2026-11-23; 63 pool/windows; 2,583 cells.
51 cells admitted, all at the coarse grains (daypart 39; dayclass-weekday 12 — no weekend cell admitted anywhere). Weekday and weekday×daypart cells sit at most 4 samples — half the gate — because per pool/window the gatherer-era series covers 19 or fewer distinct Chicago dates even in the densest pool. The adjustment slice (criterion 2) is thereby scoped to the admitted cells, and its earn-in (criterion 3) remains ahead; #13259 stays open on those.
Verification
bun teston the new suite (10/10) plus the neighbouring quota suites (quota-forecast-accuracy,quota-forecast, backtest argv) — 41/41 pass; strict scopedtscclean on the new files.{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-23T12:56:31Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": null, "model": null, "lane_start_issues": [], "workspace_ref": null, "auth_subject": "archer", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.